/**
 * 物料信息 api 封装
 *
 * @Author:    lmabbe
 * @Date:      2025-06-24 17:04:42
 * @Copyright  lmabbe
 */
import { getRequest, postRequest } from '/@/lib/axios';

export const materialInfoApi = {
  /**
   * 分页查询  @author  lmabbe
   */
  queryPage: (param) => {
    return postRequest('/materialInfo/queryPage', param);
  },

  /**
   * 增加  @author  lmabbe
   */
  add: (param) => {
    return postRequest('/materialInfo/add', param);
  },

  /**
   * 修改  @author  lmabbe
   */
  update: (param) => {
    return postRequest('/materialInfo/update', param);
  },

  /**
   * 删除  @author  lmabbe
   */
  delete: (id) => {
    return getRequest(`/materialInfo/delete/${id}`);
  },

  /**
   * 批量删除  @author  lmabbe
   */
  batchDelete: (idList) => {
    return postRequest('/materialInfo/batchDelete', idList);
  },

  searchTop10: (param) => {
    return getRequest('materialInfo/searchTop10', param);
  },

  changeDisable: (materialCode, isDisable) => {
    return postRequest(`materialInfo/${materialCode}/changeDisable/${isDisable}`);
  },
};
